The present invention generally relates to video codec and, more particularly, to methods of selecting a prediction mode to code a block in a frame of a video sequence.
Recently, with the evolution of consumer electronics, more and more multimedia-related technologies have been developed and designed for handheld devices, for example, cellular phones. In the handheld device in processing a video sequence, especially in compressing or coding a video sequence in H.264/AVC (“Advanced Video Coding”, hereinafter the H.264) format, image quality may be improved if an encoder capable of video compression is designed with relatively high computational complexity. However, the power consumption of the handheld device may also be relatively high, which may not be suitable for a handheld device with limited battery capacity. On the contrary, if an encoder capable of video compression is designed with relatively low computational complexity, even though the power consumption may be relatively low, image quality may be degraded due to loss of information or data during the compression or coding process, which may not satisfy the image quality requirements in the H.264 standard. Hence, video compression may be a trade-off between computational complexity, power consumption and image quality.
An H.264 video sequence encoder may perform an intra prediction for a block of pixels in a video sequence during an intra coding by using spatial domain information. The intra prediction may include an Intra—4×4 prediction and an Intra—16×16 prediction, wherein the Intra—4×4 prediction may comprise nine prediction modes and the Intra—16×16 prediction may comprise four prediction modes. In the H.264 standard, a video frame may be divided into a number of macroblocks, each of which is composed of 16×16 pixels. Furthermore, each of the number of macroblocks may be divided into 4×4 blocks, each of which in turn is composed of 4×4 pixels. Intra coding may use the values of reference pixels near a block to predict the values of pixels in the block. FIG. 1 shows a diagram illustrating an exemplary block 102 to be coded based on an Intra—4×4 prediction. Referring to FIG. 1, the block 102 may be comprised of pixels “a” to “p”. The values of the pixels “a” to “p” may be predicted on the basis of partial or all of reference pixels “A” to “M”.
In order to achieve optimal coding efficiency, Rate-Distortion Optimization (RDO) may be used to pre-calculate a rate-distortion cost (RD cost) for each of the prediction modes. A prediction mode with the smallest RD cost may be selected as an optimal mode for coding a block. FIG. 2 shows a block diagram illustrating a module 300 for rate-distortion optimization. Referring to FIG. 2, an original block 102 and a prediction block 304 may be fed into the rate-distortion optimization module 300 capable of performing the RDO for the prediction modes and calculating the RD cost in coding the original block for each of the prediction modes. The rate-distortion optimization module 300 may include an integer discrete cosine transform (DCT) module 306, a quantization module 308, an inverse quantization module 310, an inverse integer DCT module 312, a bit-computing module 314, a distortion computing module 318 and an RD cost computing module 316.
Due to computational complexity, the RDO technique may require relatively large computation capacity and in turn relatively high power consumption. It may be desirable to have a method that is able to reduce the computational complexity and power consumption in selecting an optimal prediction mode without compromising video compression quality.